﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Silvermoon.Classes
{
    public static class DateUtil
    {
        private const double DATE_NULL = 949998.0d;

        /// <summary>
        /// Gets the default empty date (outlook compliant).
        /// </summary>
        public static readonly DateTime EmptyDate = DateTime.FromOADate(DATE_NULL);

        /// <summary>
        /// Determines wether a date is empty.
        /// </summary>
        /// <param name="date">Date to determine.</param>
        /// <returns>True if the date is empty (DATE_NULL), otherwise false.</returns>
        public static bool IsEmpty(this DateTime date)
        {
            return date.ToOADate() == DATE_NULL;
        }
    }
}
